package zsrt.com.menu;

import java.util.Scanner;
import zsrt.com.service.SvrAdmin;
import zsrt.com.validate.Validate;

/**
 * 管理员界面
 * @author 罗智壕-13424431416
 *
 * 2017年4月20日
 */
public class AdminMenu {
	
	/**
	 * 调用业务的初始化
	 */
	
	public static void adminMenu(Scanner scanner,MenuDesign menu) {
		//调用管理员的测试类
		SvrAdmin svr = new SvrAdmin();
		boolean result = Validate.validateAdminLogin(scanner);
		if(result){
			while(true){
				menu.adminFirstMenu();
				int number = scanner.nextInt();
				if(number == 1){
					svr.examineeAdd(scanner);
				}else if(number == 2){
					svr.examineeUpdate(scanner);
				}else if(number == 3){
					svr.examineeDelete(scanner);
				}else if(number == 4){
					while(true){
						menu.queryStudentMenu();
						int find = scanner.nextInt();
						if(find == 1){
							svr.examineeQuery();
						}else if(find == 2){
							svr.examineeCity(scanner);
						}else if(find == 3){
							svr.examineeQueryByName(scanner);
						}else if(find == 4){
							svr.examineeQueryById(scanner);
						}else if(find == 5){
							break;
						}else{
							System.err.println("输入无效..请重新输入");
						}
					}
				}else if(number == 5){
					break;
				}else{
					System.err.println("输入无效..请重新输入");
				}
			}
		}else{
			System.err.println("手机号码或密码错误，请重新输入...");
		}
	}
}
